package la.iok.hzsvn.lewin.movie.core.shopmovie.param;

import java.util.Objects;

/**
 * 优惠券列表参数
 * @since 1.1.1
 */
public class CouponListParam extends CouponBaseFilterParam{
    /**
     * 用户参数过滤。可能是发放优惠券的人或者是拥有优惠券的人，关键看{@link #userType}的值
     */
    private Long userId;
    /**
     * 指明{@link #userId}的用户功能类型。1：查询userId发出的优惠券；2：查询userId拥有的优惠券
     */
    private Integer userType;
    /**
     * 优惠券状态过滤。0：未领取，1：未使用，2：部分使用，3：已使用
     */
    private Integer status;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof CouponListParam)) return false;
        if (!super.equals(o)) return false;
        CouponListParam that = (CouponListParam) o;
        return Objects.equals(userId, that.userId) && Objects.equals(userType, that.userType) && Objects.equals(status, that.status);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), userId, userType, status);
    }

    @Override
    public String toString() {
        return "CouponListParam{" +
                "orgUnitId=" + getOrgUnitId() +
                ", name='" + getName() + '\'' +
                ", type=" + getType() +
                "userId=" + userId +
                ", userType=" + userType +
                ", status=" + status +
                '}';
    }
}
